﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using TKToXML.Models;

namespace TKToXML.Test
{
    [TestClass]
    public class WebserviceTiepNhan
    {
        [TestMethod]
        public void WebserviceLive()
        {
            //Khong mock duoc do khong build duoc, chi mock duoc property virtual hoac interface
            //var mock = new Mock<CisService.CISService>();
            //mock.Setup(ser => ser.Send("", "0100101308", "66406bc4c790949aa98d07a4f79ad704"))
                //.Returns("<Envelope>");

            string result;
            CisService.CISService test = new CisService.CISService();
            //CisService.CISService test1 = mock.Object;
            result = test.Send("", "0100101308", "66406bc4c790949aa98d07a4f79ad704");
            Assert.IsTrue(result.Contains("Envelope"));
        }

        [TestMethod]
        public void Conmeo()
        {
            var mock = new Mock<IBaseChungTu>();
            mock.Setup(vd => vd.ToXML()).Returns("Hello World");
            var vanDon = mock.Object;
            Assert.AreEqual("Hello World", vanDon.ToXML());
        }
    }
}
